package com.ruoyi.hospital.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.hospital.domain.YlPackage;
import com.ruoyi.hospital.mapper.YlPackageMapper;
import com.ruoyi.hospital.service.IYlPackageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 套餐信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-16
 */
@Service
public class YlPackageServiceImpl implements IYlPackageService
{
    @Autowired
    private YlPackageMapper ylPackageMapper;

    /**
     * 查询套餐信息
     * 
     * @param packageId 套餐信息主键
     * @return 套餐信息
     */
    @Override
    public YlPackage selectYlPackageByPackageId(Long packageId)
    {
        return ylPackageMapper.selectYlPackageByPackageId(packageId);
    }

    /**
     * 查询套餐信息列表
     * 
     * @param ylPackage 套餐信息
     * @return 套餐信息
     */
    @Override
    public List<YlPackage> selectYlPackageList(YlPackage ylPackage)
    {
        return ylPackageMapper.selectYlPackageList(ylPackage);
    }

    /**
     * 新增套餐信息
     * 
     * @param ylPackage 套餐信息
     * @return 结果
     */
    @Override
    public int insertYlPackage(YlPackage ylPackage)
    {
        ylPackage.setCreateTime(DateUtils.getNowDate());
        return ylPackageMapper.insertYlPackage(ylPackage);
    }

    /**
     * 修改套餐信息
     * 
     * @param ylPackage 套餐信息
     * @return 结果
     */
    @Override
    public int updateYlPackage(YlPackage ylPackage)
    {
        ylPackage.setUpdateTime(DateUtils.getNowDate());
        return ylPackageMapper.updateYlPackage(ylPackage);
    }

    /**
     * 批量删除套餐信息
     * 
     * @param packageIds 需要删除的套餐信息主键
     * @return 结果
     */
    @Override
    public int deleteYlPackageByPackageIds(Long[] packageIds)
    {
        return ylPackageMapper.deleteYlPackageByPackageIds(packageIds);
    }

    /**
     * 删除套餐信息信息
     * 
     * @param packageId 套餐信息主键
     * @return 结果
     */
    @Override
    public int deleteYlPackageByPackageId(Long packageId)
    {
        return ylPackageMapper.deleteYlPackageByPackageId(packageId);
    }
}
